package controller.service
{
	import flash.events.Event;
	
	import model.vo.PageVO;
	
	import subumbo.micro.controller.AbstractLoader;
	import subumbo.micro.model.Model;

	public class ContentLoader extends AbstractLoader
	{
		public function ContentLoader(url:String)
		{
			super(url);
		}
		
		override protected function onComplete(e:Event):void
		{
			var _model:Model = Model.instance;
			
			var xml:XML = XML(data);
			
			
			var p:PageVO;
			var pages:Array = _model.pages;
			var i:int;
			for each(var page:XML in xml..page)
			{
				p = new PageVO();
				p.id = page.@id.toString();
				p.index = i; 
				p.name = page..name.toString();
				p.description = page..description.toString();
				pages.push(p);
				++i;
			}
			
			super.onComplete(e);
		}
		
	}
}